package com.wuage.interfaces.account.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

/**
 * @author Shynin
 * @version 1.0
 * @date 9/28/21 4:10 PM
 */
@Data
@ApiModel("新增/更新用户DO")
public class AdminSaveOrUpdateAccountDO {

    @ApiModelProperty(value = "id", required = false)
    private Long id;

    @Pattern(regexp = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$", message = "请输入正确手机号")
    @ApiModelProperty(value = "账号", required = true)
    private String username;

    @Length(min = 2, max = 64, message = "昵称长度是2-64位之间")
    @ApiModelProperty(value = "昵称", required = true)
    private String nickname;

    @ApiModelProperty(value = "密码", required = true)
    @Length(min = 6, max = 16, message = "密码必须在6到16位之间")
    private String password;

    @ApiModelProperty(value = "邮箱")
    @Length(max = 50, message = "请输入0-50位正确的邮箱")
    private String email;


    @ApiModelProperty(value = "角色", required = true)
    private String role;
}
